//==============================================================================
#include "CApp.h"

//==============================================================================
void CApp::OnEvent(SDL_Event* Event) {
    CEvent::OnEvent(Event);

    NetworkEngine.OnEvent(Event);
}

//==============================================================================
void CApp::OnKeyDown(SDLKey sym, SDLMod mod, Uint16 unicode) {
    switch(sym) {
        case SDLK_ESCAPE:   Running = false; break;

        case SDLK_LEFT: {
            if(Player) Player->X--;
            break;
        }

        case SDLK_RIGHT: {
            if(Player) Player->X++;
            break;
        }

        case SDLK_UP: {
            if(Player) Player->Y--;
            break;
        }

        case SDLK_DOWN: {
            if(Player) Player->Y++;
            break;
        }

        default: {
            break;
        }
    }
}

//------------------------------------------------------------------------------
void CApp::OnExit() {
    Running = false;
}

//==============================================================================
